<!DOCTYPE html>
<html lang="fr">
<head>
<link rel="stylesheet" href="reveal.css">
<script type="text/javascript" src="jquery.reveal.js"></script>	
<script src="js/jquery.easing.1.3.js" type="text/javascript"></script>	
<script type="text/javascript" src="http://www.google.fr/jsapi"></script>
<script type="text/javascript">
google.load("maps", "3.4", {
other_params: "sensor=false&language=fr"
});
</script>
<script type="text/javascript" src="./javascripts/jquery.googlemap.js"></script>
	
<script type="text/javascript">
		$(document).ready(function(){
		
		$(function() {
			var addresspicker =  $( "#addresspicker" ).addresspicker({
				regionBias: "fr",
				elements: {
				
			  }
			});
			});
			
		$(function() {
			$("#map").googleMap();
			$("#map").addMarker({
				coords: [33.5333333, -7.583333300000049], // GPS coords
				title: 'Marker n°1', // Title
				text:  '<b>Lorem ipsum</b> dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.' // HTML content
			});
		})
		$( "#addresspicker" ).keypress(function( event ) {
		
			if ( event.which == 13 ) {
			
				event.preventDefault();
				
				var adresse = $('#addresspicker').val();
				console.log(adresse);
				
				//vider div itineraire
				$( "#way" ).empty();
				
				
				$(function() {
					$("#map").googleMap();
					$("#map").addWay({
					start: "SIDI BERNOUSSI, Casablanca, Maroc", // Postal address for the start marker (obligatory)
					end:  adresse, // Postal Address or GPS coordinates for the end marker (obligatory)
					route : 'way', // Block's ID for the route display (optional)
					langage : 'french' // language of the route detail (optional)
					});
				});
				
		}
		
		});
		});
	</script>
</head>
<body>
	<div class='input'>
<label>Address : </label><input id="addresspicker" />

<a href="#" class="big-link" data-reveal-id="myModal" data-animation="fadeAndPop">
Fade and Pop
</a>	


</div>
	<div style='clear:left;'>
		<div id="map" style="width: 800px; height: 300px;"></div>
		<div id="way" ></div>
	</div>
</body>
</html>
<div id="myModal" class="reveal-modal">
<div style="overflow-y:scroll;height:250px;width:100%;">
<div id='way'></div>
</div>
<a class="close-reveal-modal">&#215;</a>
</div>